package p270jp.pxv.android.viewholder;

import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import p045be.MangaGridAdapter;
import p134ei.AnalyticsScreenName;
import p184gi.FirebaseScreenNameVia;
import p270jp.pxv.android.R;
import p270jp.pxv.android.activity.UserWorkActivity;
import p270jp.pxv.android.commonObjects.model.WorkType;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p270jp.pxv.android.model.PixivProfile;
import p374nm.UserProfileContentsView;
import p451qm.GridItemDecoration;

/* renamed from: jp.pxv.android.viewholder.UserProfileMangaViewHolder */
/* loaded from: classes2.dex */
public class UserProfileMangaViewHolder extends RecyclerView.AbstractC0819y {
    private static final int COLUMN_NUM;
    private static final int ROW_NUM;
    private MangaGridAdapter adapter;
    private UserProfileContentsView userProfileContentsView;

    private UserProfileMangaViewHolder(UserProfileContentsView t0Var) {
        super(t0Var);
        this.userProfileContentsView = t0Var;
        MangaGridAdapter o0Var = new MangaGridAdapter();
        this.adapter = o0Var;
        o0Var.f4838g = new FirebaseScreenNameVia(AnalyticsScreenName.USER_PROFILE, 7);
        t0Var.m3326a(new GridLayoutManager(this.itemView.getContext(), 2), new GridItemDecoration(this.itemView.getResources().getDimensionPixelSize(R.dimen.manga_item_divider_size), 2, 0), this.adapter);
    }

    public static UserProfileMangaViewHolder createViewHolderByParentView(ViewGroup viewGroup) {
        return new UserProfileMangaViewHolder(new UserProfileContentsView(viewGroup.getContext()));
    }

    public /* synthetic */ void lambda$onBindViewHolder$0(long j, PixivProfile pixivProfile, View view) {
        this.itemView.getContext().startActivity(UserWorkActivity.m4686e1(this.itemView.getContext(), j, pixivProfile, WorkType.MANGA));
    }

    public void onBindViewHolder(long j, PixivProfile pixivProfile, List<PixivIllust> list, String str) {
        this.userProfileContentsView.setTitleText(this.itemView.getContext().getString(R.string.user_profile_work_manga));
        UserProfileContentsView t0Var = this.userProfileContentsView;
        t0Var.setReadMoreText(String.valueOf(pixivProfile.totalManga) + this.itemView.getContext().getString(R.string.user_profile_works_count));
        this.userProfileContentsView.setReadMoreTextClickListener(new View.OnClickListener(j, pixivProfile) { // from class: jp.pxv.android.viewholder.m

            /* renamed from: b */
            public final /* synthetic */ long f19774b;

            /* renamed from: c */
            public final /* synthetic */ PixivProfile f19775c;

            {
                this.f19774b = r2;
                this.f19775c = r4;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                UserProfileMangaViewHolder.this.lambda$onBindViewHolder$0(this.f19774b, this.f19775c, view);
            }
        });
        MangaGridAdapter o0Var = this.adapter;
        o0Var.f4835d = list.subList(0, Math.min(2, list.size()));
        o0Var.f4836e = list;
        o0Var.f4837f = str;
        this.adapter.f3606a.m10780b();
        this.userProfileContentsView.m3325b(list, 1, 2);
    }
}
